#include <bits/stdc++.h>
// 2025/03/07
// tag:
// Author: Forever
using namespace std;

using int64 = int64_t;
signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin >> t;
    while (t--) {
        int n;
        cin >> n;
        cout << n / 15 * 3 + min(n % 15, 2) + 1 << endl;
    }
    return 0;
}